package com.lc.jpa.dao.impl;

import javax.ejb.Remote;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import com.lc.jpa.Users;
import com.lc.jpa.dao.UsersManager;

@Stateless
@Remote
public class UsersManagerBean implements UsersManager {

	@PersistenceContext(unitName = "mysql")
	private EntityManager em;

	@Override
	public void addUser(Users user) {

		System.out.println("由容器自己管理EntityManager");

		System.out.println("正在对用户：" + user.getName() + "进行插入操作");
		em.persist(user);
	}

}
